﻿package  plugins.mstandio.UniversalMap.navigation{
	
	import flash.display.Sprite;
	
	/**
	 * Describes 
	 * @author mstandio
	 */
	public class MapButton extends Sprite{
		
		public static const BUTTON_PLAIN : String = "buttonPlain";
		public static const BUTTON_OVER : String = "buttonOver";		
		public static const BUTTON_CLICKED : String = "buttonClicked";
		public static const BUTTON_SHOWING : String = "buttonShowing";
		
				
		public function MapButton():void {			
		}		
		
		/**
		 * Draws circle of specified type and size
		 * @param	buttonType
		 * @param	buttonSize
		 */
		public function drawButton(buttonType:String, buttonSize:Number):void{
		
			this.graphics.clear();
			
			this.buttonMode = true;
			this.useHandCursor = true;
			
			switch(buttonType){				
				case BUTTON_PLAIN: {
					this.graphics.beginFill(0x00ff00);
					this.graphics.lineStyle(2*buttonSize, 0x000000);
					this.graphics.drawCircle(0, 0, 15*buttonSize);
					this.graphics.endFill();
				}break;
				
				case BUTTON_OVER: {
					this.graphics.beginFill(0xffff00);
					this.graphics.lineStyle(2*buttonSize, 0x000000);
					this.graphics.drawCircle(0, 0, 15*buttonSize);
					this.graphics.endFill();
				}break;
				
				case BUTTON_CLICKED: {
					this.graphics.beginFill(0xFF0000);
					this.graphics.lineStyle(2*buttonSize, 0x000000);
					this.graphics.drawCircle(0, 0, 15*buttonSize);
					this.graphics.endFill();
				}break;
				
				case BUTTON_SHOWING: {
					this.graphics.beginFill(0xFF0000);
					this.graphics.lineStyle(2*buttonSize, 0x000000);
					this.graphics.drawCircle(0, 0, 15*buttonSize);
					this.graphics.endFill();
					
					this.buttonMode = false;
					this.useHandCursor = false;					
				}break;
			}
		}		
	}	
}